
#region Imports

using System;
using System.Collections.Generic;
using System.Text;

#endregion

namespace Justa.Data.Entity
{
    /// <summary>
    /// 
    /// </summary>
    /// 
    public sealed class EntityDefinition
    {
        /// <summary>
        /// 
        /// </summary>
        /// 
        private Type entityType;

        /// <summary>
        /// 
        /// </summary>
        /// 
        private EntityAttribute entityAttribute;

        /// <summary>
        /// 
        /// </summary>
        /// 
        private IdAttribute idAttribute;

        /// <summary>
        /// 
        /// </summary>
        /// 
        private JoinColumnAttribute joinColumnAttribute;

        /// <summary>
        /// 
        /// </summary>
        /// 
        private BeforeSaveAttribute beforeSaveAttribute;

        /// <summary>
        /// 
        /// </summary>
        /// 
        private AfterSaveAttribute afterSaveAttribute;

        /// <summary>
        /// 
        /// </summary>
        /// 
        private BeforeUpdateAttribute beforeUpdateAttribute;

        /// <summary>
        /// 
        /// </summary>
        /// 
        private AfterUpdateAttribute afterUpdateAttribute;

        /// <summary>
        /// 
        /// </summary>
        /// 
        private BeforeDeleteAttribute beforeDeleteAttribute;

        /// <summary>
        /// 
        /// </summary>
        /// 
        private AfterDeleteAttribute afterDeleteAttribute;

        /// <summary>
        /// 
        /// </summary>
        /// 
        private IDictionary<string, ColumnType> columnTypes = new Dictionary<string, ColumnType>();

        /// <summary>
        /// 
        /// </summary>
        /// 
        public Type EntityType
        {
            get { return this.entityType; }
            set { this.entityType = value; }
        }

        /// <summary>
        /// 
        /// </summary>
        /// 
        public EntityAttribute EntityAttribute
        {
            get { return this.entityAttribute; }
            set { this.entityAttribute = value; }
        }

        /// <summary>
        /// 
        /// </summary>
        /// 
        public IdAttribute IdAttribute
        {
            get { return this.idAttribute; }
            set { this.idAttribute = value; }
        }

        /// <summary>
        /// 
        /// </summary>
        /// 
        public JoinColumnAttribute JoinColumnAttribute
        {
            get { return this.joinColumnAttribute; }
            set { this.joinColumnAttribute = value; }
        }

        /// <summary>
        /// 
        /// </summary>
        /// 
        public BeforeSaveAttribute BeforeSaveAttribute
        {
            get { return this.beforeSaveAttribute; }
            set { this.beforeSaveAttribute = value; }
        }

        /// <summary>
        /// 
        /// </summary>
        /// 
        public AfterSaveAttribute AfterSaveAttribute
        {
            get { return this.afterSaveAttribute; }
            set { this.afterSaveAttribute = value; }
        }

        /// <summary>
        /// 
        /// </summary>
        /// 
        public BeforeUpdateAttribute BeforeUpdateAttribute
        {
            get { return this.beforeUpdateAttribute; }
            set { this.beforeUpdateAttribute = value; }
        }

        /// <summary>
        /// 
        /// </summary>
        /// 
        public AfterUpdateAttribute AfterUpdateAttribute
        {
            get { return this.afterUpdateAttribute; }
            set { this.afterUpdateAttribute = value; }
        }

        /// <summary>
        /// 
        /// </summary>
        /// 
        public BeforeDeleteAttribute BeforeDeleteAttribute
        {
            get { return this.beforeDeleteAttribute; }
            set { this.beforeDeleteAttribute = value; }
        }

        /// <summary>
        /// 
        /// </summary>
        /// 
        public AfterDeleteAttribute AfterDeleteAttribute
        {
            get { return this.afterDeleteAttribute; }
            set { this.afterDeleteAttribute = value; }
        }

        /// <summary>
        /// 
        /// </summary>
        /// 
        public IDictionary<string, ColumnType> ColumnTypes
        {
            get { return this.columnTypes; }
            set { this.columnTypes = value; }
        }

        /// <summary>
        /// 
        /// </summary>
        /// 
        /// <returns></returns>
        /// 
        public override string ToString()
        {
            return string.Format("Entity = {0}; ID = {1}; Column Count = {2}", this.entityAttribute, this.idAttribute, this.columnTypes.Count);
        }
    }
}
